package com.xqit.ydzhkt.common.response;


import com.xqit.ydzhkt.common.exception.BaseErrorInfoInterface;

/**
 * Created by Janus on 2019/5/22
 *
 * 响应结果枚举类型
 */
public enum ResultCodeEnum implements BaseErrorInfoInterface {

    /*==============HTTP常用==================*/
    SUCCESS("200", "成功!"),

    REDIRECT("301", "重定向"),

    BODY_NOT_MATCH("400","请求的数据格式不符!"),

    NOT_FOUND("404", "未找到该资源!"),

    SERVER_ERROR("500", "服务器内部错误!"),

    SERVER_BUSY("503","服务器正忙，请稍后再试!"),

    BY_ZERO("000","算术运算异常"),

    NULL_POINTER("001","空指针异常"),

    REQUEST_METHOD_NOT_SUPPORTED("405","请求方式错误"),


    /*===========用户登录模块 1000～1999===========*/
    OPENID_IS_NOT_EXIST("1001","微信openid不存在"),

    BINDING_OPENID_ERROR("1002","账号绑定微信失败"),

    USER_IS_NULL("1003","查询用户为NULL,账号或者密码错误"),

    OPENID_IS_BINDING("1004","此微信已绑定其他用户"),


    /*===========即时通讯模块 2000～2999===========*/
    SEND_MESSAGE_ERROR("2000","消息发送失败");


    /**
     * 响应状态码
     */
    private String code;
    /**
     * 响应信息
     */
    private String message;

    ResultCodeEnum(String code, String msg) {
        this.code = code;
        this.message = msg;
    }

    @Override
    public String getResultCode() {
        return code;
    }

    @Override
    public String getResultMsg() {
        return message;
    }
}
